<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>
    
    var reg = /a/;

    console.log( reg.test("a") );
    console.log( reg.test("b") );

    console.log( "qwerasdfzxcv".match(reg) );
    console.log( "qwersdfzxcv".match(reg) );
    
    console.log( reg.exec("qwersdfzxcv") );
    console.log( reg.exec("qwersdafzxcv") );

    console.log( "qwerasdfzxcv".search(reg) );
    console.log( "qwersdfzxcv".search(reg) );

    console.log( "qwerasdfzxcv".replace(reg, "啊") );
    console.log( "qwersdfzxcv".replace(reg, "啊") );


</script>
</html>